#define  _CRT_SECURE_NO_WARNINGS 1

#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N = 2e5 + 10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//
ll k;
ll get(ll x)
{
	ll res;
	for (res = 0; x > 0; x /= 5) res += x / 5;
	return res;
}
int main()
{
	close();
	cin >> k;
	ll l = 1, r = 5e18;
	while (l < r)
	{
		ll mid = l + r + 1 >> 1;
		if (get(mid) <= k) l = mid;
		else r = mid - 1;
	}
	//if(get(r)!=k) r=-1;
	cout < r << '\n';
	return 0;
}

// int main()
// {
// 	int l=1,r=10-1;
// 	int a[]={1,2,3,4,5,6,7,8,9,10};
// 	while(l<r)
// 	{
// 		int mid=l+r+1>>1;
// 		if(mid<=6) l=mid;
// 		else r=mid-1;
// 	}
// 	cout<<r<<'\n';

// 	return 0;
// }